package com.shensi.api.admin.client.coupon;

import com.shensi.api.admin.client.fallback.common.CommonClientFallBack;
import com.shensi.api.admin.client.fallback.coupon.CouponIssueClientFallBack;
import com.shensi.api.admin.domian.coupon.dto.CouponIssueDto;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.domain.entity.SysDept;
import com.shensi.common.core.domain.model.LoginUser;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import com.shensi.common.core.utils.SecurityUtils;
import com.shensi.common.core.utils.poi.ExcelUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Random;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = CouponIssueClientFallBack.class)
@Component
public interface CouponIssueClient {
    /**
     * 查询优惠劵发放方式列表
     */
    @GetMapping("/coupon/issue/list")
    public TableDataInfo list(@SpringQueryMap CouponIssueDto couponIssue);

    /**
     * 查询发布过的超级会员关联的发放方式
     */
    @GetMapping("/coupon/issue/list4Relation")
    public TableDataInfo list4Relation(@SpringQueryMap CouponIssueDto couponIssue);


    /**
     * 查询当前人员的发放方式
     */
    @GetMapping("/coupon/issue/listByLogin")
    public TableDataInfo listByLogin();


    /**
     * 导出优惠劵发放方式列表
     */
    @GetMapping("/coupon/issue/export")
    public AjaxResult export(@SpringQueryMap CouponIssueDto couponIssue);

    /**
     * 获取优惠劵发放方式详细信息
     */
    @GetMapping(value = "/coupon/issue/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id);

    /**
     * 新增优惠劵发放方式
     */
    @PostMapping("/coupon/issue")
    public AjaxResult add(@RequestBody CouponIssueDto couponIssue);

    /**
     * 修改优惠劵发放方式
     */
    @PutMapping("/coupon/issue")
    public AjaxResult edit(@RequestBody CouponIssueDto couponIssue);

    @PutMapping("/coupon/issue/updateCouponIssueStatus")
    public AjaxResult updateCouponIssueStatus(@RequestBody CouponIssueDto couponIssue);
    /**
     * 删除优惠劵发放方式
     */
    @DeleteMapping("/coupon/issue/{ids}")
    public AjaxResult remove(@PathVariable("ids") Integer[] ids);

}
